	$("#appConfig-base-form #select-user").click(function(){
		 dataSelector.open("选择人员",ctxPath+"/auth/orgUserdata!userTree.action","#appConfig-base-form input[name='perAuthority.authorityData']","#appConfig-base-form input[name='perAuthority.authorityDataName']");
	 });
	 $("#appConfig-base-form #select-dept").click(function(){
		 dataSelector.open("选择部门",ctxPath+"/auth/orgUserdata!orgTree.action","#appConfig-base-form input[name='deptAuthority.authorityData']","#appConfig-base-form input[name='deptAuthority.authorityDataName']");
	 });
	 $("#appConfig-base-form #select-role").click(function(){
		 dataSelector.open("选择角色",ctxPath+"/auth/orgUserdata!roleTree.action","#appConfig-base-form input[name='roleAuthority.authorityData']","#appConfig-base-form input[name='roleAuthority.authorityDataName']");
	 });
	 
	 $("#appConfig-base-form select[name='entity.selectFlowId']").change(function(){
		 $('#appConfig-base-form select[name="entity.flowId"]').empty();
		 $.ajax({
				url : ctxPath+"/workflow/appConfig!findVersion.action",
				data : $("#appConfig-base-form").serialize(),
				type : 'post',
				success : function(msg) {
					$('#appConfig-base-form select[name="entity.flowId"]').append(msg);
					$('#appConfig-base-form select[name="entity.flowId"]').find("option[value='"+$('#appConfig-base-form select[name="entity.flowId"]').attr("value")+"']").attr("selected","selected");
				},
				error : function() {
				}
		 });
	 });
	 
	 if($('#appConfig-base-form input[name="id"]').val()){
		 //应用基本信息保存后，显示字段管理
		 $.ajax({
				url : ctxPath+"/workflow/appConfig!getTabAuth.action",
				data : "appId="+$('#appConfig-base-form input[name="id"]').val(),
				type : 'post',
				success : function(msg) {
					msg = util.strToObj(msg);
					if(msg[0]=="1"){//字段管理
						$('a[href="#field-manage"]').parent("li").show();
					}else{
						$('a[href="#field-manage"]').parent("li").hide();
					}
					if(msg[1]=="1"){//表单模板
						$('a[href="#form-template"]').parent("li").show();
					}else{
						$('a[href="#form-template"]').parent("li").hide();
					}
					if(msg[2]=="1"){//字段读写性设置
						$('a[href="#field-auth"]').parent("li").show();
					}else{
						$('a[href="#field-auth"]').parent("li").hide();
					}
					if(msg[3]=="1"){//流程操作权限
						$('a[href="#flow-operate"]').parent("li").show();
					}else{
						$('a[href="#flow-operate"]').parent("li").hide();
					}
				},
				error : function() {
				}
		 });
	 }